import { Module, Global } from '@nestjs/common';
import { RedisModule } from 'nestjs-redis';
import { RedisUtilsService } from './redis-utils.service';

// 将该模块设置为全局模块
@Global()
@Module({
  imports: [
    RedisModule.register({
      // 配置redis基本信息
      port: 6379,
      host: '127.0.0.1',
      password: '',
      db: 0,
    }),
  ],
  providers: [RedisUtilsService],
  exports: [RedisUtilsService],
})
export class RedisUtilsModule {}
